﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace camcad7Home
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute( // xong. chu xem code cadcenter thi` thay ta
               "xemtin",
               "{loaitin}/{tieude}/n{id}.html",
              new { controller = "Tintuc", action = "xemtintuc", id = UrlParameter.Optional }

           );
            routes.MapRoute(
              "Xemtintrang", // Route name
              "{tieude}-{id}.html", // domain.com/{}-{}.html
              new { controller = "Trang", action = "xemtintuc" } // Parameter defaults

          );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
            
           // routes.MapRoute(
           //     "xemtintuc",
           //     "{loaitin}/{tieude}-{id}.html",
           //     new { controller = "Tintuc", action = "xemtintuc" }
           //);
             
           
        }
    }
}